-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add timeout support to libhv adapter. #1109
Conversation
cc @ithewei This is my attempt to add timeout support to your adapter. I'm unfamiliar with the library so please let me know if my usage is correct. Edit: I think this logic isn't ideal if users update the timeouts multiple times (as it will add a bunch of timers). Is there a mechanism in |
You are right, and you can use htimer_reset to update timeout multiple times. |
6883ef5
to
eafc6f9
Compare
@ithewei If you don't mind taking a look at the new timeout logic that would be great. In reading the @bjosv Let me know if anything jumps out at you. It should now be possible/efficient to update timeouts arbitrarily when using |
9b240b6
to
d8e7f10
Compare
Keep track of any timer we have set so we can just update it if the user changes the timeout, rather than continuously adding new timers. The semantics differ slightly from other adapters as libhv disallows zero'd timers.
d8e7f10
to
6e4f81d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Maybe example users would get helped by a comment in debugCallback()
that we expect a NULL reply since DEBUG SLEEP should timeout..
..but it LGTM as is.
Add timeout support to our libhv adapter.
See: #904